/* Vlcmm plugin */

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#include "gototime.hh"

#include <gtkmm/frame.h>
#include <gtkmm/label.h>
#include <gtkmm/spinbutton.h>
#include <gtkmm/stock.h>

#include <vlc/vlc.h>
#include <vlc_about.h>
#include <vlc_intf_strings.h>

#include "util/string.hh"

GotoTimeDialog::GotoTimeDialog (Gtk::Window *parent)
{

  if (parent)
    set_transient_for (*parent);

  set_title (_("Go to time"));
  set_has_separator (false);
  set_border_width (4);

  // - - - - - -

  Gtk::Frame *frame = new Gtk::Frame (_( "Go to time:" ));

  Gtk::VBox *vbox = new Gtk::VBox (false, false);
  vbox->set_border_width (4);
  vbox->pack_start (*new Gtk::Label ("hh : mm : ss"), false, false, 4);

  Gtk::HBox *hbox = new Gtk::HBox (false, false);

  Gtk::SpinButton *spin_button_hh = new Gtk::SpinButton ();
  hbox->pack_start (*Gtk::manage (spin_button_hh));

  Gtk::SpinButton *spin_button_mm = new Gtk::SpinButton ();
  hbox->pack_start (*Gtk::manage (spin_button_mm));

  Gtk::SpinButton *spin_button_ss = new Gtk::SpinButton ();
  hbox->pack_start (*Gtk::manage (spin_button_ss));
  /* FIXME : need grouped spinbuttons with QT like hh:mm:ss format */

  vbox->pack_start (*Gtk::manage (hbox));
  
  frame->add (*Gtk::manage (vbox));

  get_vbox ()->pack_start (*Gtk::manage (frame));

  // - - - - - -

  add_button (Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL)->signal_clicked ().connect (sigc::mem_fun (this, &GotoTimeDialog::close));
  add_button (Gtk::Stock::APPLY, Gtk::RESPONSE_APPLY)->signal_clicked ().connect (sigc::mem_fun (this, &GotoTimeDialog::apply));

  // - - - - - -

  show_all ();

}

GotoTimeDialog::~GotoTimeDialog ()
{}

void
GotoTimeDialog::close ()
{

  delete this;

}

void
GotoTimeDialog::apply ()
{

  delete this;

}

